package com.tqfframe.studydemo.proxy.cglibProxy.customer;


import com.tqfframe.studydemo.proxy.cglibProxy.api.UserApi;
import com.tqfframe.studydemo.proxy.cglibProxy.provider.UserApiImpl;
import com.tqfframe.studydemo.proxy.cglibProxy.util.CglibProxy;

/**
 * Created by Tang-QiFeng on 2022/2/17
 */
public class UserController {
    public static void main(String[] args) {
        UserApi userApi=new UserApiImpl();
        //代理对象
        UserApi user = (UserApi) new CglibProxy(userApi).getProxyInstance();
        user.insert("唐",11,1);
        user.insert("王",12,2);
        user.insert("黄",44,3);
        System.out.println(user.getUserInfo(2));
        user.delete(3);
        System.out.println(user.getAllUser());

    }
}
